﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;

using MyEntLibCMS.Domain.Properties;

namespace MyEntLibCMS.Domain.Models
{
    public class User
    {
        ///<summary>
        ///用户ID
        ///</summary>
        public int UserID
        {
            get;
            set;
        }

        ///<summary>
        ///姓名
        ///</summary>
        [Required(AllowEmptyStrings = false, ErrorMessageResourceName = "UserNameRequired",ErrorMessageResourceType=typeof(Resources))]
        [StringLength(50, ErrorMessageResourceName = "UserNameLength",ErrorMessageResourceType=typeof(Resources))]
        public string UserName
        {
            get;
            set;
        }

        ///<summary>
        ///性别：1表示男；0表示女
        ///</summary>
        public bool Sex
        {
            get;
            set;
        }

        ///<summary>
        ///职务
        ///</summary>
        public string Office
        {
            get;
            set;
        }

        ///<summary>
        ///出生日期
        ///</summary>
        public DateTime? BirthDate
        {
            get;
            set;
        }

        ///<summary>
        ///照片路径
        ///</summary>
        public string PhotosUrl
        {
            get;
            set;
        }

        ///<summary>
        ///用户状态：1表示有效；0表示无效
        ///</summary>
        public bool Status
        {
            get;
            set;
        }

        ///<summary>
        ///备注
        ///</summary>
        public string Remarks
        {
            get;
            set;
        }

        ///<summary>
        ///登陆账号
        ///</summary>
        [Required(AllowEmptyStrings = false, ErrorMessageResourceName = "UserLoginAccountRequired", ErrorMessageResourceType = typeof(Resources))]
        public string LoginAccount
        {
            get;
            set;
        }

        ///<summary>
        ///密码
        ///</summary>
        [Required(AllowEmptyStrings = false, ErrorMessageResourceName = "UserPasswordRequired", ErrorMessageResourceType = typeof(Resources))]
        public string Password
        {
            get;
            set;
        }

        ///<summary>
        ///登陆日期
        ///</summary>
        public DateTime? LoginTime
        {
            get;
            set;
        }

        ///<summary>
        ///登陆IP
        ///</summary>
        public string LoginIP
        {
            get;
            set;
        }

    }
}
